﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

public partial class UserControl_TopLink : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie _user = Request.Cookies["userinfo"];
        StringBuilder sb = new StringBuilder();
        sb.Append("<ul>");
        try
        {
            if (Request.Cookies["userinfo"] != null)
            {
                if (_user["username"] != null || _user["username"] != "")
                {
                    sb.Append("<li><a href='" + ResolveUrl("~/CurrentPoint.html") + "'><img src='" + ResolveUrl("~/images/img_1.png") + "' alt='' />Điểm số</a></li>");
                    sb.Append("<li><a href='" + ResolveUrl("~/Thongtincanhan.html") + "'><img src='" + ResolveUrl("~/images/img_2.png") + "' alt='' />Quản lý tài khoản</a></li>");
                    sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_3.png") + "' alt='' />Hộp thư</a></li>");
                    sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_4.png") + "' alt='' />Email Marketing</a></li>");
                    sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_5.png") + "' alt='' />Giỏ hàng</a></li>");
                    sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_6.png") + "' alt='' />Danh sách ưa thích</a></li>");
                    sb.Append("<li class='no-border'><a href='#'><img src='" + ResolveUrl("~/images/img_7.png") + "' alt='' />Cảnh báo</a></li>");
                }
                else
                {
                    sb.Append("<li><a id='divsignin' href='javascript:void(0);'><img src='" + ResolveUrl("~/images/login.png") + "' alt='' />Đăng nhập</a></li>");
                    sb.Append("<li><a href='" + ResolveUrl("~/Dangki.html") + "'><img src='" + ResolveUrl("~/images/register.png") + "' alt='' />Đăng kí</a></li>");
                    sb.Append("<li><a href='" + ResolveUrl("~/CurrentPoint.html") + "'><img src='" + ResolveUrl("~/images/img_1.png") + "' alt='' />Điểm số</a></li>");
                    sb.Append("<li><a href='" + ResolveUrl("~/Thongtincanhan.html") + "'><img src='" + ResolveUrl("~/images/img_2.png") + "' alt='' />Quản lý tài khoản</a></li>");
                    sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_3.png") + "' alt='' />Hộp thư</a></li>");
                    sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_4.png") + "' alt='' />Email Marketing</a></li>");
                    sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_5.png") + "' alt='' />Giỏ hàng</a></li>");
                    sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_6.png") + "' alt='' />Danh sách ưa thích</a></li>");
                    sb.Append("<li class='no-border'><a href='#'><img src='" + ResolveUrl("~/images/img_7.png") + "' alt='' />Cảnh báo</a></li>");
                }
            }
            else
            {
                sb.Append("<li><a id='divsignin' href='javascript:void(0);'><img src='" + ResolveUrl("~/images/login.png") + "' alt='' />Đăng nhập</a></li>");
                sb.Append("<li><a href='" + ResolveUrl("~/Dangki.html") + "'><img src='" + ResolveUrl("~/images/register.png") + "' alt='' />Đăng kí</a></li>");
                sb.Append("<li><a href='" + ResolveUrl("~/CurrentPoint.html") + "'><img src='" + ResolveUrl("~/images/img_1.png") + "' alt='' />Điểm số</a></li>");
                sb.Append("<li><a href='" + ResolveUrl("~/Thongtincanhan.html") + "'><img src='" + ResolveUrl("~/images/img_2.png") + "' alt='' />Quản lý tài khoản</a></li>");
                sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_3.png") + "' alt='' />Hộp thư</a></li>");
                sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_4.png") + "' alt='' />Email Marketing</a></li>");
                sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_5.png") + "' alt='' />Giỏ hàng</a></li>");
                sb.Append("<li><a href='#'><img src='" + ResolveUrl("~/images/img_6.png") + "' alt='' />Danh sách ưa thích</a></li>");
                sb.Append("<li class='no-border'><a href='#'><img src='" + ResolveUrl("~/images/img_7.png") + "' alt='' />Cảnh báo</a></li>");
            }
        }
        catch (Exception ex)
        {
        }
        sb.Append("</ul>");
        ltrtoplink.Text = sb.ToString();
    }
}